<?php
    $this->title = "Club";
    $this->headTitle($this->title);

    require_once "models/Db/Gallery_db.php";
    $club = new Gallery_db();
    $i=0;

    $allDisco = $this->allDisco;
    $zonaList = $this->zonaList;
?>
<?php
/**
 *  dispay all disco in  sponsor0
 */
$line = '<div id="box">';
foreach ($allDisco as $key=>$allDisco2){
    $line_new = '<h2><a href="'. $this->url(array('controller'=>'Club',
                                                  'name'=> $allDisco2[0],
                                                   ), 'locale', TRUE) .'">' . $allDisco2[1]
              . '</a></h2>';
    $line = $line . $line_new;
    }
$line = $line . '</div>';
$this->layout()->sponsor0 = $line;

/**
 * dispay all "provincia" in  provincia
 */
$line4 = '';
foreach ($zonaList as $key=>$zonaList2){
    $line4_new = '<h2><a href="'. $this->url(array('controller'=>'Index',
                                                    'action'=>'provincia',
                                                    'id'=> $zonaList2,
                                                   ), 'index', TRUE) .'">' . $zonaList2 . '</a></h2>';
    $line4 = $line4 . $line4_new;
    }
$line4 = $line4 . '';
$this->layout()->provincia = $line4;
?>
<table>
    <tr>
        <th>&nbsp;</th>
        <th>&nbsp;</th>
        <th>&nbsp;</th>
        <th>&nbsp;</th>
    </tr>
    
    <?php
        require_once 'models/Db/Event_db.php';
        $eventHandle = new Event_db();
        foreach($this->disco as $disco) :
            $club_logo = $club->getDiscoImgThumbPath($disco['piva']);
            $name_disco = $eventHandle->getUniqueNamebyPiva($disco['piva']);
    ?>
    <tr class="club_list">
        <td><img src="<?php echo $club_logo; ?>" alt="<?php echo $this->escape($disco['name']); ?>" /></td>
        <td><?php echo $this->escape($disco['name']); ?></td>
        <td class="view_event"><a class="event" href="<?php
                                        echo $this->url(array('controller'=>'Index',
                                                              'action'=>'eventi',
                                                              'id'=>$name_disco['unique_name'] ),
                                                              'index', true);
                                                            ?>">
                <span class="club_link_span"><br />&nbsp;&nbsp;Eventi</span></a>
        </td>
        <td class="club_page"><a class="club_link_b" href="<?php
                                        echo $this->url(array('controller'=>'Club',
                                                              'name'=>$name_disco['unique_name'],
                                                              ),
                                                              'locale', true);?>">
                <span class="club_link_span">Club page</span></a>
        </td>
    </tr>
    <?php endforeach; ?>
</table>